/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package bombercloud;

import java.awt.Color;
import java.util.Random;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;

/**
 *
 * @author Leonardo Oliveira Moreira
 */
public class Block {

    private long id;
    private int x;
    private int y;

    private JPanel block;

    private Scenario scenario;

    private int blockHeight;
    private int blockWidth;

    public Block(Scenario scenario, int x, int y) {
        this.scenario = scenario;
        this.id = System.nanoTime();
        this.block = new JPanel(null);
        this.x = x;
        this.y = y;
        this.blockHeight = scenario.getSizeOfBlock().height;
        this.blockWidth = scenario.getSizeOfBlock().width;
        this.block.setSize(blockWidth, blockHeight);
        JLabel icon = new JLabel(new ImageIcon(Block.class.getResource("block.png")));
        icon.setSize(this.block.getSize());
        this.block.add(icon);
    }

    public JPanel getBlock() {
        return block;
    }

    public int getBlockHeight() {
        return blockHeight;
    }

    public int getBlockWidth() {
        return blockWidth;
    }

}
